<template>
  <div id="app">
    <router-view v-wechat-title="$route.meta.title"></router-view>
  </div>
</template>

<script>
export default {
  mounted() {
    function setDocumentRem() {
      const html = document.documentElement;
      const wW = html.clientWidth; // 窗口宽度
      const rem = wW / 10;
      document.documentElement.style.fontSize = rem + "px";
    }
    // 初始化
    setDocumentRem();
    // 改变窗口大小时重新设置 rem
    window.onresize = function() {
      setDocumentRem();
    };
  }
};
</script>

<style lang="less">
@import "./style/reset.less";
#app {
  height: 100%;
  overflow-y: scroll;
  margin: 0 auto;
  width: 100%;
}
</style>